<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <title>健身俱乐部管理系统 - 登录</title>
    <link rel="stylesheet" href="css/sLogin.css">
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script>
        function validateForm() {
            var userType = document.getElementsByName('userType')[0].value;
            var memberId = document.getElementsByName('memberId')[0].value;

            if (userType === 'member' && memberId === '') {
                alert('请输入会员ID');
                return false;
            }
            return true;
        }
    </script>
</head>
<body>
<div class="login-container">
    <h2><i class="fa fa-user-circle"></i> 用户登录</h2>
    <div class="error">${error}</div>
    <form action="LoginServlet" method="post" onsubmit="return validateForm();">
        <div class="form-group">
            <label for="userType">用户类型：</label>
            <select id="userType" name="userType">
                <option value="admin">管理员</option>
                <option value="member">会员</option>
            </select>
        </div>
        <div class="form-group">
            <label for="memberId">会员ID：</label>
            <input type="text" id="memberId" name="memberId" placeholder="请输入会员ID" />
        </div>
        <button type="submit">
            <i class="fa fa-sign-in"></i> 登录
        </button>
    </form>
</div>
</body>
</html>